<%@ Page EnableViewState="false" Language="C#" AutoEventWireup="true" MasterPageFile="theme.Master" Inherits="CommunityServer.Hubs.Controls.CSHubThemePage" %>

<asp:Content ContentPlaceHolderID="tr" runat="server">
    <CSControl:Title runat="server" IncludeSiteName="true" IncludeSectionOrHubName="false" EnableRendering="true" Tag="H1" CssClass="CommonTitle">
        <ContentTemplate><CSHub:HubData runat="server" Property="Name" /></ContentTemplate>
    </CSControl:Title>
</asp:Content>

<asp:Content ContentPlaceHolderID="bcr" runat="server">
    <div class="CommonContentBox">
        <div class="CommonContentBoxContent">
            <CSControl:PlaceHolder runat="server">
                <DisplayConditions Operator="Not">
                    <CSControl:SectionMembershipPropertyValueComparison runat="server" UseAccessingUser="true" ComparisonProperty="MembershipType" Operator="EqualTo" ComparisonValue="Owner" />
                    <CSControl:SectionMembershipPropertyValueComparison runat="server" UseAccessingUser="true" ComparisonProperty="MembershipType" Operator="EqualTo" ComparisonValue="Member" />
                    <CSControl:SectionMembershipPropertyValueComparison runat="server" UseAccessingUser="true" ComparisonProperty="MembershipType" Operator="EqualTo" ComparisonValue="Manager" />
                    <CSControl:UserPropertyValueComparison runat="server" UseAccessingUser="true" ComparisonProperty="IsAnonymous" Operator="IsSetOrTrue" />
                    <CSControl:QueryStringPropertyValueComparison runat="server" QueryStringProperty="AccessRequestSent" Operator="IsSetOrTrue" />
                    <CSControl:QueryStringPropertyValueComparison runat="server" QueryStringProperty="AccessRequestAccepted" Operator="IsSetOrTrue" />
                    <CSControl:UserInRoleCondition runat="server" Role="SystemAdministrator" UseAccessingUser="true" />
                </DisplayConditions>
                <ContentTemplate>
                    <div class="CommonMessageWarning">
                        <CSControl:ConditionalContent runat="server">
                            <ContentConditions>
                                <CSHub:HubPropertyValueComparison runat="server" ComparisonProperty="MembershipIsOpen" Operator="issetortrue" />
                            </ContentConditions>
                            <TrueContentTemplate>
                                <CSControl:ResourceControl runat="server" ResourceName="Hubs_OpenNotMemberMessage" />
                            </TrueContentTemplate>
                            <FalseContentTemplate>
                                <CSControl:ResourceControl runat="server" ResourceName="Hubs_NotMemberMessage" />
                            </FalseContentTemplate>
                        </CSControl:ConditionalContent>
                    </div>
                </ContentTemplate>
            </CSControl:PlaceHolder>
    
            <CSControl:PlaceHolder runat="server" Tag="Div" CssClass="CommonMessageSuccess">
                <DisplayConditions><CSControl:QueryStringPropertyValueComparison runat="server" QueryStringProperty="AccessRequestSent" Operator="IsSetOrTrue" /></DisplayConditions>
                <ContentTemplate>
                    <CSControl:ResourceControl runat="server" ResourceName="Hubs_RequestSentMessage" />
                </ContentTemplate>
            </CSControl:PlaceHolder>
    
            <CSControl:PlaceHolder runat="server" Tag="Div" CssClass="CommonMessageSuccess">
                <DisplayConditions><CSControl:QueryStringPropertyValueComparison runat="server" QueryStringProperty="AccessRequestAccepted" Operator="IsSetOrTrue" /></DisplayConditions>
                <ContentTemplate>
                    <CSControl:ResourceControl runat="server" ResourceName="Hubs_RequestAcceptedMessage" />
                </ContentTemplate>
            </CSControl:PlaceHolder>
        
            <div style="float: left; width: 80px; height: 80px; overflow: hidden; padding-right: 10px;">
                <CSHub:HubAvatar runat="server" BorderWidth="0" Width="80" Height="80" />
            </div>
            <div style="margin-left: 90px;">
                <CSHub:HubData Property="Description" runat="server" EnsureVisibleHtml="true" />
                <CSControl:PlaceHolder runat="server">
                    <DisplayConditions Operator="Not"><CSHub:HubPropertyValueComparison runat="server" ComparisonProperty="HtmlDescription" Operator="ContainsVisibleHtml" /></DisplayConditions>
                    <ContentTemplate>
                        A description has not yet been added to this group.
                        <CSHub:HubData LinkTo="Edit" Text="Edit this group and add a description" Tag="P" runat="server" />
                    </ContentTemplate>
                </CSControl:PlaceHolder>
            </div>        
            <div style="clear: both;"></div>
        </div>
            
        <CSControl:IndexPostList runat="server" ShowHeaderFooterOnNone="false" ID="RecentPostList">
            <QueryOverrides CacheMinutes="5" PageSize="5" PageIndex="0" SortBy="DateDescending" />
            <HeaderTemplate>
                <h2 class="CommonContentBoxHeader"><CSControl:ResourceControl ResourceName="Hubs_RecentContent" runat="server" /></h2>
                <div class="CommonContentBoxContent">
                    <ul class="CommonAvatarListItemList">
            </HeaderTemplate>
            <ItemTemplate>
                <CSControl:IndexPostData runat="server" Property="ApplicationType" Text="&lt;li class=&quot;CommonAvatarListItemArea {0}&quot;&gt;" />
                    <CSControl:IndexPostData runat="server" Property="Title" LinkTo="Post" Tag="h4" CssClass="CommonAvatarListItemName" />
                    <div class="CommonAvatarListItem">
                        <CSControl:IndexPostData Property="FormattedBody" runat="server" TruncateAt="350" />
                    </div>
                </li>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <CSControl:IndexPostData runat="server" Property="ApplicationType" Text="&lt;li class=&quot;CommonAvatarListItemArea {0} Alt&quot;&gt;" />
                    <CSControl:IndexPostData runat="server" Property="Title" LinkTo="Post" Tag="h4" CssClass="CommonAvatarListItemName" />
                    <div class="CommonAvatarListItem">
                        <CSControl:IndexPostData Property="FormattedBody" runat="server" TruncateAt="350" />
                    </div>
                </li>
            </AlternatingItemTemplate>
            <FooterTemplate>
                    </ul>
                </div>
            </FooterTemplate>
            <NoneTemplate></NoneTemplate>
        </CSControl:IndexPostList>
    
    </div>

</asp:Content>

<asp:Content ContentPlaceHolderID="rcra" runat="server">
    
    <CSControl:ConditionalContent runat="server">
            <ContentConditions>
                <CSHub:HubPropertyValueComparison runat="server" ComparisonProperty="MembershipIsOpen" Operator="issetortrue" />    
            </ContentConditions>
            <TrueContentTemplate>
                <CSHub:RequestMembershipForm runat="server" MessageTextBoxId="RequestAccessMessage" SubmitButtonId="RequestButton">
                    <DisplayConditions Operator="Not">
                        <CSControl:QueryStringPropertyValueComparison runat="server" QueryStringProperty="AccessRequestSent" Operator="IsSetOrTrue" />
                    </DisplayConditions>
                    <RequestSentActions>
                        <CSControl:GoToModifiedUrlAction runat="server" QueryStringModification="AccessRequestSent=true" />
                    </RequestSentActions>
                    <RequestAcceptedActions>
                        <CSControl:GoToModifiedUrlAction runat="server" QueryStringModification="AccessRequestAccepted=true" />
                    </RequestAcceptedActions>
                    <FormTemplate>
                         <div class="CommonContentBox">
                            <h4 class="CommonContentBoxHeader"><CSControl:ResourceControl runat="server" ResourceName="Hubs_JoinGroup" /></h4>
                            <div class="CommonContentBoxContent">
                            <CSControl:ResourceControl runat="server" ResourceName="Hubs_JoinMembership_Desc" />
                            <div class="CommonFormArea">
                                <div class="CommonFormFieldName">
                                    <CSControl:ResourceButton runat="server" ID="RequestButton" ResourceName="Hubs_JoinGroup" />
                                </div>
                            </div>
                            </div>
                        </div>
                    </FormTemplate>
                </CSHub:RequestMembershipForm>  
            </TrueContentTemplate>
            <FalseContentTemplate>
                <CSHub:RequestMembershipForm runat="server" MessageTextBoxId="RequestAccessMessage" SubmitButtonId="RequestButton">
                    <DisplayConditions Operator="Not">
                        <CSControl:QueryStringPropertyValueComparison runat="server" QueryStringProperty="AccessRequestSent" Operator="IsSetOrTrue" />
                    </DisplayConditions>
                    <RequestSentActions>
                        <CSControl:GoToModifiedUrlAction runat="server" QueryStringModification="AccessRequestSent=true" />
                    </RequestSentActions>
                    <RequestAcceptedActions>
                        <CSControl:GoToModifiedUrlAction runat="server" QueryStringModification="AccessRequestAccepted=true" />
                    </RequestAcceptedActions>
                    <FormTemplate>
                        <div class="CommonContentBox">
                            <h4 class="CommonContentBoxHeader"><CSControl:ResourceControl runat="server" ResourceName="Hubs_RequestMembership" /></h4>
                            <div class="CommonContentBoxContent">
                            <CSControl:ResourceControl runat="server" ResourceName="Hubs_RequestMembership_Desc" />
                            <div class="CommonFormArea">                    
                                <CSControl:PlaceHolder runat="server">
                                    <DisplayConditions><CSControl:ControlVisibilityCondition runat="server" ControlId="RequestAccessMessage" ControlVisiblilityEquals="true" /></DisplayConditions>
                                    <ContentTemplate>
                                        <CSControl:FormLabel runat="server" ResourceName="CreateEditPost_Body" LabelForId="RequestAccessMessage" CssClass="CommonFormFieldName" />
                                        <div class="CommonFormField">
                                            <asp:TextBox runat="server" TextMode="MultiLine" Rows="5" style="width: 90%;" ID="RequestAccessMessage" />
                                        </div>
                                    </ContentTemplate>
                                </CSControl:PlaceHolder>
                                <div class="CommonFormFieldName">
                                    <CSControl:ResourceButton runat="server" ID="RequestButton" ResourceName="Hubs_RequestMembership" />
                                </div>
                            </div>
                            </div>
                        </div>
                    </FormTemplate>
                </CSHub:RequestMembershipForm>
            </FalseContentTemplate>
        </CSControl:ConditionalContent>
            
</asp:Content>